package chapter19;

public class Chapter19Main {

    public static void main(String[] args) {
        RootNode H = new RootNode();
        Node x1 = new Node(1);
        Node x2 = new Node(2);
        Node x3 = new Node(3);
        Node x4 = new Node(4);
        Node x5 = new Node(5);
        Node x6 = new Node(6);

        FibHeap.insert(H, x3);
        System.out.println("insert H->" + H);
        FibHeap.insert(H, x2);
        System.out.println("insert H->" + H);
        FibHeap.insert(H, x1);
        System.out.println("insert H->" + H);
        FibHeap.insert(H, x4);
        System.out.println("insert H->" + H);
        FibHeap.insert(H, x5);
        System.out.println("insert H->" + H);
        FibHeap.insert(H, x6);
        System.out.println("insert H->" + H);
        // TODO bug
        Node min = FibHeap.extractMin(H);
        System.out.println("extractMin min->" + min);
        System.out.println("extractMin H->" + H);
        FibHeap.decreaseKey(H, x6, 5);
        System.out.println("decreaseKey H->" + H);
        FibHeap.delete(H, x5);
        System.out.println("delete H->" + H);

        RootNode H1 = new RootNode();
        Node x7 = new Node(7);
        Node x8 = new Node(8);
        Node x9 = new Node(9);
        Node x10 = new Node(10);
        FibHeap.insert(H1, x7);
        FibHeap.insert(H1, x8);
        FibHeap.insert(H1, x9);
        FibHeap.insert(H1, x10);

        RootNode H2 = FibHeap.union(H, H1);
        System.out.println("H->" + H2);
    }
}
